//
//  LTLOriginalMicro-blog.m
//  WeiBo
//
//  Created by LiTaiLiang on 16/10/18.
//  Copyright © 2016年 LTL. All rights reserved.
//

#import "LTLOriginalMicro-blog.h"
#import "LTLOrigina.h"
#import "LTLforward.h"
#import "LTLDi.h"

@interface LTLOriginalMicro_blog ()

@property(nonatomic,strong) LTLOrigina *OriginaView;

@property(nonatomic,strong) LTLforward *forwardView;

@property(nonatomic,strong) LTLDi *diView;

@end

@implementation LTLOriginalMicro_blog

+(instancetype)initCell:(UITableView *)tableView
{
    static NSString *ID                    = @"shouYe";
    LTLOriginalMicro_blog  *cell   = [tableView dequeueReusableCellWithIdentifier:ID];
    //判断cell是否为空
    if (!cell) {
        cell                                   = [[LTLOriginalMicro_blog alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }


    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ( (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) != nil ) {
        
        [self setUI];
        
    }
    return self;
}
//设置UI控件



-(void)setUI
{
    [self.contentView addSubview:self.OriginaView];
    [self.contentView addSubview:self.forwardView];
    [self.contentView addSubview:self.diView];
}

-(LTLOrigina *)OriginaView
{
    if (_OriginaView == nil) {
        
//        _OriginaView = [[LTLOrigina alloc]init];
        _OriginaView = [[LTLOrigina alloc]initWithFrame:CGRectMake(0, 0, self.width, 200)];
        
    }
    return  _OriginaView;
}
-(LTLforward *)forwardView
{
    if (_forwardView == nil) {
        
        _forwardView = [[LTLforward alloc]initWithFrame:CGRectMake(0, 0, mainWidth, 200)];
        
    }
    return  _forwardView;
}
-(LTLDi *)diView
{
    if (_diView == nil) {
        _diView = [[LTLDi alloc]initWithFrame:CGRectMake(0, 0, mainWidth, 38)];
    }
    return _diView;
}
-(void)setModel:(LTLframeModel *)model
{
    _model = model;
    
    self.OriginaView.frameModel = model;
    self.OriginaView.highly = model.OriginalHeight;
    self.forwardView.frameModel = model;
    self.forwardView.y = model.OriginalHeight;
    self.forwardView.highly = model.forwardHeight;
    self.diView.model = model.model;
    self.diView.y = CGRectGetMaxY(self.forwardView.frame);
    self.diView.highly = model.DIHeight;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
